using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Manager;
using MicroMsg.Plugin.FaceBook;
using MicroMsg.Plugin.QQInfo.Manager;
using MicroMsg.Protocol;
using MicroMsg.Resource.@string;
using MicroMsg.Scene;
using MicroMsg.Storage;
using MicroMsg.UI.UserContrl;
using MicroMsg.UI.Util;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Microsoft.Phone.Tasks;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace MicroMsg.UI.Page
{
	public class ContactDetailViewForAll : BasePage
	{
		private enum AppBarKind
		{
			Kind_Null,
			Kind_Freind,
			Kind_NotFreind
		}
		private const string TAG = "ContactDetailViewForAll";
		public ContactDetailViewArgs mContactDitailViewArgs;
		private MobileContact mMobileContact;
		private bool mBIsFirstLoaded = true;
		private bool mBIsInitedCtrls;
		private ProfileTopInfoCtrl topInfoCtrl;
		private ProfileTxtContentCtrl ctrlRemark;
		private ProfileTxtContentCtrl ctrlArea;
		private ProfileTxtContentCtrl ctrlVerify;
		private ProfileClickContentGridCtrl ctrlTWeibo;
		private ProfileInfoWithHeadCtrl ctrlMoblie;
		private ProfileInfoWithHeadCtrl ctrlQQ;
		private ProfileInfoWithHeadCtrl ctrlFaceBook;
		private ProfileTxtContentCtrl ctrlSource;
		private int mNCtrlAreaIndex;
		private EventWatcher mWatcherSceneAddContactEvent;
		private EventWatcher mWatcherSceneHeadImgEvent;
		private EventWatcher mWatcherVerifyIcon;
		private EventWatcher mWatcherExpose;
		private EventWatcher mWatcherLbsSayHi;
		private object mObjectWatcher = new object();
		private bool mBIsInitedUI;
		private DateTime mTimeLastRefresh = DateTime.get_Now();
		private bool mBHasAblumCtrl;
		private ProfileAblumCtrl ablumCtrl;
		private bool mBHasBrandListCtrl;
		private ProfileBrandListCtrl brandListCtrl;
		private string mStrSayHiOrigin = "";
		private bool isFriendBar;
		private ContactDetailViewForAll.AppBarKind mAppBarKind;
		private ApplicationBarMenuItem blackListMenuItem;
		private ApplicationBar mBarSelf;
		internal Grid LayoutRoot;
		internal ScrollViewer svRoot;
		internal StackPanel panelProfile;
		internal StackPanel panelContentInfo;
		internal Grid panelAblum;
		internal StackPanel panelMobileContactNotMMUser;
		internal TextBlock txtPhoneName2;
		internal Button btnSendInvite;
		internal Button btnAcceptInvite;
		internal Button btnExpose;
		internal Button btnSayHi;
		private bool _contentLoaded;
		public ContactDetailViewForAll()
		{
			this.InitializeComponent();
			base.add_Loaded(new RoutedEventHandler(this.ContactDetailViewForAll_Loaded));
			base.add_Unloaded(new RoutedEventHandler(this.ContactDetailViewForAll_Unloaded));
		}
		private void ContactDetailViewForAll_Loaded(object sender, RoutedEventArgs e)
		{
			this.initUI();
			if (this.mBIsFirstLoaded)
			{
				base.get_Dispatcher().BeginInvoke(delegate
				{
					this.checkContact();
				});
				this.mBIsFirstLoaded = false;
			}
		}
		private void ContactDetailViewForAll_Unloaded(object sender, RoutedEventArgs e)
		{
		}
		protected override void OnPageIn(object[] object_0)
		{
			Log.smethod_5("ContactDetailViewForAll", "OnPageIn");
			if (object_0 != null && object_0.Length != 0)
			{
				if (object_0[0].GetType() == typeof(ContactDetailViewArgs))
				{
					this.mContactDitailViewArgs = (object_0[0] as ContactDetailViewArgs);
					if (this.mContactDitailViewArgs != null && this.mContactDitailViewArgs.mContact != null && this.mContactDitailViewArgs.mContact.strUsrName == AccountMgr.strUsrName)
					{
						this.mContactDitailViewArgs.mContact = ContactMgr.GetContactFromAccount(true);
					}
					this.initCtrls();
					this.initUI();
					base.get_Dispatcher().BeginInvoke(delegate
					{
						this.registerEvent();
					});
					return;
				}
			}
		}
		private void initCtrls()
		{
			if (this.mBIsInitedCtrls)
			{
				return;
			}
			this.mBIsInitedCtrls = true;
			this.topInfoCtrl = ProfileTopInfoCtrl.GetOneItem();
			this.topInfoCtrl.mImgHeadClicked += new MMStandardUIEvent(this.topInfoCtrl_mImgHeadClicked);
			this.topInfoCtrl.mBtnRemarkClick += new MMStandardUIEvent(this.topInfoCtrl_mBtnRemarkClick);
			this.panelProfile.get_Children().Insert(0, this.topInfoCtrl);
			this.ctrlTWeibo = ProfileClickContentGridCtrl.GetOneItem();
			PresentationFrameworkCollection<UIElement> arg_81_0 = this.panelContentInfo.get_Children();
			int expr_77 = 1;
			int arg_7A_0 = expr_77 + 1;
			arg_81_0.Insert(expr_77, this.ctrlTWeibo);
			this.ctrlRemark = ProfileTxtContentCtrl.GetOneItem();
			PresentationFrameworkCollection<UIElement> arg_A7_0 = this.panelContentInfo.get_Children();
			int expr_9D = 2;
			int arg_A0_0 = expr_9D + 1;
			arg_A7_0.Insert(expr_9D, this.ctrlRemark);
			this.ctrlArea = ProfileTxtContentCtrl.GetOneItem();
			PresentationFrameworkCollection<UIElement> arg_CD_0 = this.panelContentInfo.get_Children();
			int expr_C3 = 3;
			int arg_C6_0 = expr_C3 + 1;
			arg_CD_0.Insert(expr_C3, this.ctrlArea);
			this.mNCtrlAreaIndex = 4;
			this.ctrlMoblie = ProfileInfoWithHeadCtrl.GetOneItem();
			PresentationFrameworkCollection<UIElement> arg_FA_0 = this.panelContentInfo.get_Children();
			int expr_F0 = 4;
			int arg_F3_0 = expr_F0 + 1;
			arg_FA_0.Insert(expr_F0, this.ctrlMoblie);
			this.ctrlQQ = ProfileInfoWithHeadCtrl.GetOneItem();
			PresentationFrameworkCollection<UIElement> arg_120_0 = this.panelContentInfo.get_Children();
			int expr_116 = 5;
			int arg_119_0 = expr_116 + 1;
			arg_120_0.Insert(expr_116, this.ctrlQQ);
			this.ctrlFaceBook = ProfileInfoWithHeadCtrl.GetOneItem();
			PresentationFrameworkCollection<UIElement> arg_146_0 = this.panelContentInfo.get_Children();
			int expr_13C = 6;
			int arg_13F_0 = expr_13C + 1;
			arg_146_0.Insert(expr_13C, this.ctrlFaceBook);
			this.ctrlSource = ProfileTxtContentCtrl.GetOneItem();
			PresentationFrameworkCollection<UIElement> arg_16C_0 = this.panelContentInfo.get_Children();
			int expr_162 = 7;
			int arg_165_0 = expr_162 + 1;
			arg_16C_0.Insert(expr_162, this.ctrlSource);
		}
		private void topInfoCtrl_mBtnRemarkClick(object sender, object args)
		{
			base.get_Dispatcher().BeginInvoke(delegate
			{
				this.topInfoCtrl.HideBtnRemark();
			});
			object[] array = new object[2];
			array[0] = new DelegateSetRemark(this.setRemarkName);
			string text = this.mContactDitailViewArgs.mContact.strNickName;
			if (ToolFunction.checkIsLegalRemark(this.mContactDitailViewArgs.mContact.strRemark))
			{
				text = this.mContactDitailViewArgs.mContact.strRemark;
			}
			array[1] = text;
			base.GoToPage("/Source/UI/Contact/ContactSetRemarkView.xaml", array, false);
		}
		private void CollectCtrls()
		{
			ProfileTopInfoCtrl.PushOneItem(this.topInfoCtrl);
			if (this.topInfoCtrl != null)
			{
				this.topInfoCtrl.mImgHeadClicked -= new MMStandardUIEvent(this.topInfoCtrl_mImgHeadClicked);
				this.topInfoCtrl.mBtnRemarkClick -= new MMStandardUIEvent(this.topInfoCtrl_mBtnRemarkClick);
			}
			this.topInfoCtrl = null;
			ProfileTxtContentCtrl.PushOneItem(this.ctrlRemark);
			this.ctrlRemark = null;
			ProfileTxtContentCtrl.PushOneItem(this.ctrlArea);
			this.ctrlArea = null;
			ProfileClickContentGridCtrl.PushOneItem(this.ctrlTWeibo);
			this.ctrlTWeibo = null;
			ProfileInfoWithHeadCtrl.PushOneItem(this.ctrlMoblie);
			this.ctrlMoblie = null;
			ProfileInfoWithHeadCtrl.PushOneItem(this.ctrlQQ);
			this.ctrlQQ = null;
			ProfileInfoWithHeadCtrl.PushOneItem(this.ctrlFaceBook);
			this.ctrlFaceBook = null;
			ProfileTxtContentCtrl.PushOneItem(this.ctrlSource);
			this.ctrlSource = null;
			ProfileAblumCtrl.PushOneItem(this.ablumCtrl);
			this.ablumCtrl = null;
			ProfileBrandListCtrl.PushOneItem(this.brandListCtrl);
			this.brandListCtrl = null;
			this.mBIsInitedCtrls = false;
		}
		private void checkContact()
		{
			if (this.mContactDitailViewArgs == null)
			{
				return;
			}
			if (this.mContactDitailViewArgs.mContact != null)
			{
				ContactMgr.tryRefreshContact(this.mContactDitailViewArgs.mContact);
			}
		}
		protected override void OnPageOut()
		{
			Log.smethod_5("ContactDetailViewForAll", "OnPageOut");
			this.unRegisterEvent();
			base.get_Dispatcher().BeginInvoke(delegate
			{
				this.CollectCtrls();
			});
		}
		protected override void OnPageBack()
		{
			this.btnSendInvite.set_IsEnabled(true);
		}
		private void registerEvent()
		{
			if (this.mWatcherSceneAddContactEvent == null)
			{
				this.mWatcherSceneAddContactEvent = new EventWatcher(this.mObjectWatcher, null, new EventHandlerDelegate(this.onSceneEventAddContactHandler));
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_ADDCONTACT_SUCCESS, this.mWatcherSceneAddContactEvent);
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_ADDCONTACT_NEEDVIRIFY, this.mWatcherSceneAddContactEvent);
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_ADDCONTACT_ERR, this.mWatcherSceneAddContactEvent);
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_VERIFYUSER_SUCCESS, this.mWatcherSceneAddContactEvent);
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_VERIFYUSER_ERR, this.mWatcherSceneAddContactEvent);
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_ACCEPTVERIFYUSER_SUCCESS, this.mWatcherSceneAddContactEvent);
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_ACCEPTVERIFYUSER_ERR, this.mWatcherSceneAddContactEvent);
				EventCenter.registerEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatcherSceneAddContactEvent);
				EventCenter.registerEventWatcher(EventConst.ON_STORAGE_CONTACT_MODIFY, this.mWatcherSceneAddContactEvent);
			}
			if (this.mWatcherSceneHeadImgEvent == null)
			{
				this.mWatcherSceneHeadImgEvent = new EventWatcher(this.mObjectWatcher, null, new EventHandlerDelegate(this.onSceneEventHeadImgHandler));
				EventCenter.registerEventWatcher(EventConst.ON_MGR_HEAD_IMG_READY, this.mWatcherSceneHeadImgEvent);
				EventCenter.registerEventWatcher(EventConst.ON_GET_CURRENT_HEADIMG_COMPLETE, this.mWatcherSceneHeadImgEvent);
			}
			if (this.mWatcherVerifyIcon == null)
			{
				this.mWatcherVerifyIcon = new EventWatcher(this.mObjectWatcher, null, new EventHandlerDelegate(this.onVerifyFlagEventHandler));
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_VUSERINFO_UPDATED, this.mWatcherVerifyIcon);
			}
			if (this.mWatcherExpose == null)
			{
				this.mWatcherExpose = new EventWatcher(this.mObjectWatcher, null, new EventHandlerDelegate(this.onEventHandlerExpose));
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_EXPOSE_SUCCESS, this.mWatcherExpose);
				EventCenter.registerEventWatcher(EventConst.ON_NETSCENE_EXPOSE_ERR, this.mWatcherExpose);
			}
			if (this.mWatcherLbsSayHi == null)
			{
				this.mWatcherLbsSayHi = new EventWatcher(this.mObjectWatcher, null, new EventHandlerDelegate(this.onEventHandlerLbsSayHi));
				EventCenter.registerEventWatcher(EventConst.ON_LBS_SAYHI_SUCCESS, this.mWatcherLbsSayHi);
				EventCenter.registerEventWatcher(EventConst.ON_LBS_SAYHI_ERROR, this.mWatcherLbsSayHi);
			}
		}
		private void unRegisterEvent()
		{
			if (this.mWatcherSceneAddContactEvent != null)
			{
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_ADDCONTACT_SUCCESS, this.mWatcherSceneAddContactEvent);
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_ADDCONTACT_NEEDVIRIFY, this.mWatcherSceneAddContactEvent);
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_ADDCONTACT_ERR, this.mWatcherSceneAddContactEvent);
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_VERIFYUSER_SUCCESS, this.mWatcherSceneAddContactEvent);
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_VERIFYUSER_ERR, this.mWatcherSceneAddContactEvent);
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_ACCEPTVERIFYUSER_SUCCESS, this.mWatcherSceneAddContactEvent);
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_ACCEPTVERIFYUSER_ERR, this.mWatcherSceneAddContactEvent);
				EventCenter.removeEventWatcher(EventConst.ON_STORAGE_CONTACT_ADD, this.mWatcherSceneAddContactEvent);
				EventCenter.removeEventWatcher(EventConst.ON_STORAGE_CONTACT_MODIFY, this.mWatcherSceneAddContactEvent);
				this.mWatcherSceneAddContactEvent = null;
			}
			if (this.mWatcherSceneHeadImgEvent != null)
			{
				EventCenter.removeEventWatcher(EventConst.ON_MGR_HEAD_IMG_READY, this.mWatcherSceneHeadImgEvent);
				EventCenter.removeEventWatcher(EventConst.ON_GET_CURRENT_HEADIMG_COMPLETE, this.mWatcherSceneHeadImgEvent);
				this.mWatcherSceneHeadImgEvent = null;
			}
			if (this.mWatcherVerifyIcon != null)
			{
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_VUSERINFO_UPDATED, this.mWatcherVerifyIcon);
				this.mWatcherVerifyIcon = null;
			}
			if (this.mWatcherExpose != null)
			{
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_EXPOSE_SUCCESS, this.mWatcherExpose);
				EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_EXPOSE_ERR, this.mWatcherExpose);
				this.mWatcherExpose = null;
			}
			if (this.mWatcherLbsSayHi != null)
			{
				EventCenter.removeEventWatcher(EventConst.ON_LBS_SAYHI_SUCCESS, this.mWatcherLbsSayHi);
				EventCenter.removeEventWatcher(EventConst.ON_LBS_SAYHI_ERROR, this.mWatcherLbsSayHi);
				this.mWatcherLbsSayHi = null;
			}
		}
		private void onSceneEventHeadImgHandler(EventWatcher watcher, BaseEventArgs evtArgs)
		{
			if (evtArgs == null)
			{
				return;
			}
			if (EventConst.ON_MGR_HEAD_IMG_READY == evtArgs.mEventID)
			{
				List<string> listObject = evtArgs.getListObject<string>();
				if (listObject == null)
				{
					return;
				}
				using (List<string>.Enumerator enumerator = listObject.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						string current = enumerator.get_Current();
						if (current != null && current.GetType() == typeof(string))
						{
							this._updateUserHead(current);
						}
					}
					return;
				}
			}
			if (EventConst.ON_GET_CURRENT_HEADIMG_COMPLETE == evtArgs.mEventID)
			{
				if (evtArgs.mObject != null)
				{
					if (evtArgs.mObject.GetType() == typeof(Dictionary<string, Stream>))
					{
						this.refreshMoblieHeadImg(evtArgs.mObject as Dictionary<string, Stream>);
						return;
					}
				}
				Log.smethod_5("ContactDetailViewForAll", "evtArgs Error:onSceneEventHeadImgHandler:ON_GET_CURRENT_HEADIMG_COMPLETE");
				return;
			}
		}
		private void _updateUserHead(string strUserName)
		{
			if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mContact == null || this.mContactDitailViewArgs.mContact.strUsrName == null)
			{
				return;
			}
			if (strUserName == this.mContactDitailViewArgs.mContact.strUsrName)
			{
				this.getUserImg();
				return;
			}
			if (ContactDetailFromType.FROM_FRIENDPUSH_QQ == this.mContactDitailViewArgs.mFromType)
			{
				if (this.mContactDitailViewArgs.mObject is FMessageFriendInfo)
				{
					FMessageFriendInfo fMessageFriendInfo = this.mContactDitailViewArgs.mObject as FMessageFriendInfo;
					string text = HeadImgMgr.qq2strUserName((uint)fMessageFriendInfo.qqNum);
					if (strUserName == text)
					{
						this.ctrlQQ.SetHead(HeadImgMgr.getHeadImage(text, true));
						return;
					}
				}
			}
			else
			{
				if (this.mContactDitailViewArgs.mContact.nSource.get_HasValue())
				{
					uint? nSource = this.mContactDitailViewArgs.mContact.nSource;
					if (nSource.GetValueOrDefault() != 4u || !nSource.get_HasValue())
					{
						uint? nSource2 = this.mContactDitailViewArgs.mContact.nSource;
						if (nSource2.GetValueOrDefault() != 12u || !nSource2.get_HasValue())
						{
							return;
						}
					}
					Contact mContact = this.mContactDitailViewArgs.mContact;
					QFriend qQFreindByContact = this.getQQFreindByContact(mContact);
					if (qQFreindByContact != null && strUserName == qQFreindByContact.nQQ + "@qqim")
					{
						this.ctrlQQ.SetHead(HeadImgMgr.getHeadImage(qQFreindByContact.nQQ + "@qqim", true));
					}
				}
			}
		}
		private void onSceneEventAddContactHandler(EventWatcher watcher, BaseEventArgs evtArgs)
		{
			if (evtArgs == null)
			{
				return;
			}
			if (EventConst.ON_STORAGE_CONTACT_ADD != evtArgs.mEventID)
			{
				if (EventConst.ON_STORAGE_CONTACT_MODIFY != evtArgs.mEventID)
				{
					AddContactEventArgs addContactEventArgs;
					if (!evtArgs.checkType<AddContactEventArgs>() && evtArgs.mObject != null)
					{
						addContactEventArgs = (AddContactEventArgs)evtArgs.mObject;
					}
					else
					{
						addContactEventArgs = new AddContactEventArgs();
					}
					if (EventConst.ON_NETSCENE_ADDCONTACT_SUCCESS != evtArgs.mEventID)
					{
						if (EventConst.ON_NETSCENE_ACCEPTVERIFYUSER_SUCCESS != evtArgs.mEventID)
						{
							if (EventConst.ON_NETSCENE_ADDCONTACT_NEEDVIRIFY == evtArgs.mEventID)
							{
								Log.smethod_5("ContactDetailViewForAll", "ON_NETSCENE_ADDCONTACT_NEEDVIRIFY");
								if (evtArgs.mObject != null && evtArgs.mObject is string)
								{
									string text = evtArgs.mObject as string;
									if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mContact == null)
									{
										return;
									}
									if (text != this.mContactDitailViewArgs.mContact.strUsrName)
									{
										return;
									}
								}
								Dialog2BtnWithInputBox.Show(strings.Con_Detail_MsgNeedVerifyTitle, strings.Con_Detail_MsgNeedVerifyContent, strings.COM_Confirm, strings.COM_Cancel, "", new Dialog2BtnWithInputBox.dismissWithClickBtn(this.SayHiDialogHandler), null, null);
								ProcessingCover.releaseProgressBar(this.LayoutRoot);
								return;
							}
							if (EventConst.ON_NETSCENE_ACCEPTVERIFYUSER_ERR == evtArgs.mEventID)
							{
								if (evtArgs.mObject != null && evtArgs.mObject is string)
								{
									string text2 = evtArgs.mObject as string;
									if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mContact == null)
									{
										return;
									}
									if (text2 != this.mContactDitailViewArgs.mContact.strUsrName)
									{
										return;
									}
								}
								Log.smethod_5("ContactDetailViewForAll", "ON_NETSCENE_ACCEPTVERIFYUSER_ERR");
								MMMessageBox.Show(strings.Con_Detail_MsgAccFailed, true, "确定");
								ProcessingCover.releaseProgressBar(this.LayoutRoot);
								return;
							}
							if (EventConst.ON_NETSCENE_ADDCONTACT_ERR == evtArgs.mEventID)
							{
								if (evtArgs.mObject != null && evtArgs.mObject is string)
								{
									string text3 = evtArgs.mObject as string;
									if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mContact == null)
									{
										return;
									}
									if (text3 != this.mContactDitailViewArgs.mContact.strUsrName)
									{
										return;
									}
								}
								Log.smethod_5("ContactDetailViewForAll", "ON_NETSCENE_ADDCONTACT_ERR or ON_NETSCENE_VERIFYUSER_ERR");
								if (addContactEventArgs.result == RetConst.MM_ERR_BLACKLIST)
								{
									MMMessageBox.Show(strings.Con_Detail_MsgBeReject, true, "确定");
								}
								else
								{
									MMMessageBox.Show(strings.Con_Detail_MsgAddFailed, true, "确定");
								}
								ProcessingCover.releaseProgressBar(this.LayoutRoot);
								return;
							}
							if (EventConst.ON_NETSCENE_VERIFYUSER_ERR == evtArgs.mEventID)
							{
								if (evtArgs.mObject != null && evtArgs.mObject is string)
								{
									string text4 = evtArgs.mObject as string;
									if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mContact == null)
									{
										return;
									}
									if (text4 != this.mContactDitailViewArgs.mContact.strUsrName)
									{
										return;
									}
								}
								if (evtArgs.mObject == null)
								{
									return;
								}
								if (RetConst.MM_ERR_CLIENT == addContactEventArgs.result)
								{
									Log.smethod_5("ContactDetailViewForAll", "ON_LBS_SAYHI_ERROR:" + addContactEventArgs.result);
									MMMessageBox.Show(strings.Con_Detail_MsgBadNet, true, "确定");
									return;
								}
								if (RetConst.MM_ERR_SPAM == addContactEventArgs.result)
								{
									Log.smethod_5("ContactDetailViewForAll", "ON_LBS_SAYHI_ERROR:" + addContactEventArgs.result);
									MMMessageBox.Show(strings.Con_Detail_MsgSpam, true, "确定");
									return;
								}
								if (RetConst.MM_ERR_FREQ_LIMITED == addContactEventArgs.result)
								{
									MMMessageBox.Show(strings.Con_Detail_MsgTooFreq, true, "确定");
									return;
								}
								Log.smethod_5("ContactDetailViewForAll", "ON_LBS_SAYHI_ERROR:" + addContactEventArgs.result);
								MMMessageBox.Show(strings.Con_Detail_MsgSendFailed, true, "确定");
								return;
							}
							else
							{
								if (EventConst.ON_NETSCENE_VERIFYUSER_SUCCESS == evtArgs.mEventID)
								{
									if (evtArgs.mObject != null && evtArgs.mObject is string)
									{
										string text5 = evtArgs.mObject as string;
										if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mContact == null)
										{
											return;
										}
										if (text5 != this.mContactDitailViewArgs.mContact.strUsrName)
										{
											return;
										}
									}
									MessageBoxManager.ShowToast(strings.Con_Detail_MsgSendSucc, 2500, null, false);
									ProcessingCover.releaseProgressBar(this.LayoutRoot);
									return;
								}
								return;
							}
						}
					}
					if (evtArgs.mObject != null && evtArgs.mObject is string)
					{
						string text6 = evtArgs.mObject as string;
						if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mContact == null)
						{
							return;
						}
						if (text6 != this.mContactDitailViewArgs.mContact.strUsrName)
						{
							return;
						}
					}
					Log.smethod_5("ContactDetailViewForAll", "ON_NETSCENE_ADDCONTACT_SUCCESS");
					QFriendMgr.SetQFriendContact(this.mContactDitailViewArgs.mContact.strUsrName, true);
					ContactMgr.setContact(this.mContactDitailViewArgs.mContact, true);
					StorageMgr.contact.update(this.mContactDitailViewArgs.mContact);
					if (this.mMobileContact != null)
					{
						this.mMobileContact.nStatus = 2;
						MobileContactMgr.updatemContactToFriend(this.mMobileContact, true);
					}
					Log.smethod_5("ContactDetailViewForAll", "after add mContactDitailViewArgs.mContact.nFlags = " + this.mContactDitailViewArgs.mContact.nFlags);
					MessageBoxManager.ShowToast(strings.Con_Detail_MsgAddSucc, 2500, null, false);
					ProcessingCover.releaseProgressBar(this.LayoutRoot);
					if (string.IsNullOrEmpty(this.mContactDitailViewArgs.mContact.strRemark))
					{
						this.topInfoCtrl.ShowBtnRemark();
						this.btnAcceptInvite.set_Visibility(1);
						return;
					}
					return;
				}
			}
			if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mContact == null)
			{
				return;
			}
			List<Contact> listObject = evtArgs.getListObject<Contact>();
			if (listObject == null)
			{
				return;
			}
			using (List<Contact>.Enumerator enumerator = listObject.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					Contact current = enumerator.get_Current();
					if (current != null && current.GetType() == typeof(Contact) && current.strUsrName == this.mContactDitailViewArgs.mContact.strUsrName)
					{
						if (ContactMgr.isContact(current))
						{
							QFriendMgr.SetQFriendContact(current.strUsrName, true);
						}
						this.mContactDitailViewArgs.mContact = StorageMgr.contact.method_0(this.mContactDitailViewArgs.mContact.strUsrName);
						this.refreshUI();
						break;
					}
				}
			}
		}
		private void SayHiDialogHandler(object sender, int nClickIndex)
		{
			if (nClickIndex == 0 && sender != null && sender is Dialog2BtnWithInputBox)
			{
				Dialog2BtnWithInputBox dialog2BtnWithInputBox = sender as Dialog2BtnWithInputBox;
				string text = dialog2BtnWithInputBox.txtIn.get_Text();
				if (text == null || text.get_Length() == 0)
				{
					text = strings.Con_Detail_TxtVerifyInfo;
				}
				ServiceCenter.sceneVerifyUser.doSceneSendRequestForAddContact(this.mContactDitailViewArgs.mContact.strUsrName, text, this.getAddContactScene());
			}
		}
		private void onVerifyFlagEventHandler(EventWatcher watcher, BaseEventArgs evtArgs)
		{
			this.disVerifyIcon();
		}
		private void onEventHandlerExpose(EventWatcher watcher, BaseEventArgs evtArgs)
		{
			if (evtArgs == null)
			{
				return;
			}
			if (EventConst.ON_NETSCENE_EXPOSE_SUCCESS == evtArgs.mEventID)
			{
				MessageBoxManager.ShowToast(strings.Lbs_PeoInfo_MsgExposeSucc, 2500, null, false);
				return;
			}
			if (EventConst.ON_NETSCENE_EXPOSE_ERR == evtArgs.mEventID)
			{
				MMMessageBox.Show(strings.Lbs_PeoInfo_MsgExposeFail, true, "确定");
			}
		}
		private void onEventHandlerLbsSayHi(EventWatcher watcher, BaseEventArgs evtArgs)
		{
			if (EventConst.ON_LBS_SAYHI_SUCCESS == evtArgs.mEventID)
			{
				MessageBoxManager.ShowToast(strings.Lbs_PeoInfo_MsgSayHiSucc, 2500, null, false);
				Log.smethod_5("ContactDetailViewForAll", "ON_LBS_SAYHI_SUCCESS");
				return;
			}
			if (EventConst.ON_LBS_SAYHI_ERROR == evtArgs.mEventID && evtArgs.mObject != null)
			{
				RetConst retConst = (RetConst)evtArgs.mObject;
				if (RetConst.MM_ERR_CLIENT == retConst)
				{
					MMMessageBox.Show(strings.Con_Detail_MsgBadNet, true, "确定");
				}
				else
				{
					if (RetConst.MM_ERR_SPAM == retConst)
					{
						MMMessageBox.Show(strings.Con_Detail_MsgSpam, true, "确定");
					}
					else
					{
						if (RetConst.MM_ERR_FREQ_LIMITED == retConst)
						{
							MMMessageBox.Show(strings.Lbs_PeoInfo_MsgTooFreq, true, "确定");
						}
						else
						{
							if (RetConst.MM_ERR_LBSBANBYEXPOSE == retConst)
							{
								MMMessageBox.Show(strings.Lbs_PeoInfo_MsgBadMan, true, "确定");
							}
							else
							{
								if (RetConst.MM_ERR_BLACKLIST == retConst)
								{
									MMMessageBox.Show(strings.Lbs_PeoInfo_MsgBeBlocked, true, "确定");
								}
								else
								{
									MMMessageBox.Show(strings.Con_Detail_MsgSendFailed, true, "确定");
								}
							}
						}
					}
				}
				Log.smethod_5("ContactDetailViewForAll", "ON_LBS_SAYHI_ERROR:" + retConst);
			}
		}
		private void refreshUI()
		{
			this.mBIsInitedUI = false;
			this.initUI();
		}
		private void initUI()
		{
			if (this.mBIsInitedUI)
			{
				return;
			}
			this.mBIsInitedUI = true;
			if (this.mContactDitailViewArgs == null)
			{
				base.GoBack();
				return;
			}
			if (this.mContactDitailViewArgs.mContact != null)
			{
				this.disNames();
				this.disAreaAndSig();
				this.disSex();
				this.disVerifyInfo();
				this.disAddScene();
			}
			this.disFaceBookInfo();
			this.disTencentWeibo();
			this.disRemark();
			this.disHeadImg();
			this.setAppBar();
			this.disMobileInfo();
			this.disQQInfo();
			this.disFreindRequest();
			this.disAblum();
			this.disBrandList();
			this.disStar();
		}
		private void disHeadImg()
		{
			this.getUserImg();
		}
		private void getUserImg()
		{
			if (ContactDetailFromType.FROM_LBS == this.mContactDitailViewArgs.mFromType)
			{
				if (this.mContactDitailViewArgs != null && this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is LbsPeople)
				{
					this.topInfoCtrl.imgHead.set_Source(HeadImgMgr.getHeadImage(this.mContactDitailViewArgs.mObject as LbsPeople));
					return;
				}
			}
			else
			{
				if (ContactDetailFromType.FROM_QRCODE == this.mContactDitailViewArgs.mFromType)
				{
					if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mObject == null || !(this.mContactDitailViewArgs.mObject is BitmapImage))
					{
						this.topInfoCtrl.imgHead.set_Source(HeadImageMgr.defaultHeadImage);
						return;
					}
					BitmapImage bitmapImage = (BitmapImage)this.mContactDitailViewArgs.mObject;
					if (bitmapImage.get_PixelWidth() != 0)
					{
						this.topInfoCtrl.imgHead.set_Source(bitmapImage);
						return;
					}
					this.topInfoCtrl.imgHead.set_Source(HeadImageMgr.defaultHeadImage);
					return;
				}
				else
				{
					if (this.mContactDitailViewArgs == null || this.mContactDitailViewArgs.mContact == null || this.mContactDitailViewArgs.mContact.strUsrName == null)
					{
						return;
					}
					this.topInfoCtrl.imgHead.set_Source(HeadImgMgr.getHeadImage(this.mContactDitailViewArgs.mContact));
				}
			}
		}
		private void disNames()
		{
			Contact mContact = this.mContactDitailViewArgs.mContact;
			if (mContact.strUsrName == "fmessage")
			{
				this.topInfoCtrl.txtNicks.Text = strings.Con_FMsg_TxtName;
			}
			else
			{
				if (mContact.strUsrName == "weixin")
				{
					this.topInfoCtrl.txtNicks.Text = strings.Con_Plugin_Weixin;
				}
				else
				{
					this.topInfoCtrl.txtNicks.Text = mContact.strNickName;
				}
			}
			if (this.mContactDitailViewArgs.mFromType == ContactDetailFromType.FROM_QRCODE)
			{
				return;
			}
			this.topInfoCtrl.SetID(mContact.strUsrName, mContact.strAlias);
		}
		private void disRemark()
		{
			if (this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is FMessageFriendInfo)
			{
				FMessageFriendInfo fMessageFriendInfo = this.mContactDitailViewArgs.mObject as FMessageFriendInfo;
				if (!string.IsNullOrEmpty(fMessageFriendInfo.qqRemark))
				{
					this.displayRemark(fMessageFriendInfo.qqRemark);
					return;
				}
			}
			if (this.mContactDitailViewArgs.mContact != null)
			{
				this.displayRemark(this.mContactDitailViewArgs.mContact.strRemark);
			}
		}
		private void displayRemark(string strRemark)
		{
			this.topInfoCtrl.SetRemark(strRemark);
		}
		private void disFreindRequest()
		{
			if (ContactDetailFromType.FROM_FRIENDVERIFY == this.mContactDitailViewArgs.mFromType && this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is FMessageValidInfo)
			{
				FMessageValidInfo fMessageValidInfo = this.mContactDitailViewArgs.mObject as FMessageValidInfo;
				if (!ToolFunction.isBlankString(fMessageValidInfo.content))
				{
					this.topInfoCtrl.SetRequestStr(fMessageValidInfo.content);
				}
			}
		}
		private void disAreaAndSig()
		{
			Contact mContact = this.mContactDitailViewArgs.mContact;
			string regionShow = ToolFunction.GetRegionShow(mContact.strProvince, mContact.strCity);
			if (regionShow != null && 1 < regionShow.get_Length())
			{
				this.ctrlArea.InfoData = ProfileDataMgr.GetAreaInfo(regionShow);
			}
			if (mContact.strSignature != null)
			{
				if (mContact.strSignature.get_Length() == 0)
				{
					return;
				}
				this.topInfoCtrl.SetSignature(mContact.strSignature);
			}
		}
		private void disQQInfo()
		{
			this.ctrlQQ.set_Visibility(1);
			if (ContactDetailFromType.FROM_FRIENDPUSH_QQ == this.mContactDitailViewArgs.mFromType)
			{
				if (this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is FMessageFriendInfo)
				{
					FMessageFriendInfo fMessageFriendInfo = this.mContactDitailViewArgs.mObject as FMessageFriendInfo;
					string text = fMessageFriendInfo.qqNum.ToString();
					if (!string.IsNullOrEmpty(text) && text != "0")
					{
						this.ctrlQQ.InfoData = ProfileDataMgr.GetQQInfo(fMessageFriendInfo.qqNickname, text, HeadImgMgr.getHeadImage(text + "@qqim", true));
						return;
					}
					this.ctrlQQ.set_Visibility(1);
					return;
				}
			}
			else
			{
				Contact mContact = this.mContactDitailViewArgs.mContact;
				if (mContact != null)
				{
					uint arg_C5_0 = mContact.nQQ;
					QFriend qQFreindByContact = this.getQQFreindByContact(mContact);
					if (qQFreindByContact != null)
					{
						this.ctrlQQ.InfoData = ProfileDataMgr.GetQQInfo(qQFreindByContact.strQQNickName, string.Concat(qQFreindByContact.nQQ), HeadImgMgr.getHeadImage(qQFreindByContact.nQQ + "@qqim", true));
						this.ctrlQQ.set_Visibility(0);
					}
				}
			}
		}
		private QFriend getQQFreindByContact(Contact contact_0)
		{
			if (contact_0 == null)
			{
				return null;
			}
			QFriend qFriend = null;
			if (!string.IsNullOrEmpty(contact_0.strUsrName))
			{
				qFriend = QFriendMgr.getQFriend(contact_0.strUsrName);
			}
			if (qFriend == null)
			{
				uint nQQ = contact_0.nQQ;
				if (nQQ > 0u)
				{
					qFriend = StorageMgr.qfriend.method_1(nQQ);
				}
			}
			return qFriend;
		}
		private void disMobileInfo()
		{
			this.panelMobileContactNotMMUser.set_Visibility(1);
			if (this.ctrlMoblie.get_Visibility() == null && this.mMobileContact != null)
			{
				return;
			}
			if (ContactDetailFromType.FROM_MOBILECONTACT == this.mContactDitailViewArgs.mFromType && this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is MobileContact)
			{
				this.mMobileContact = (this.mContactDitailViewArgs.mObject as MobileContact);
			}
			if (this.mMobileContact == null)
			{
				Contact mContact = this.mContactDitailViewArgs.mContact;
				if (mContact != null)
				{
					this.mMobileContact = ServiceCenter.mobileContactMgr.getMobileContactByUserName(mContact.strUsrName);
				}
				if (this.mMobileContact == null && this.mContactDitailViewArgs.mFromType == ContactDetailFromType.FROM_FRIENDPUSH_MOBILE)
				{
					FMessageFriendInfo fMessageFriendInfo = this.mContactDitailViewArgs.mObject as FMessageFriendInfo;
					if (fMessageFriendInfo != null && fMessageFriendInfo.phoneNumMD5 != null)
					{
						this.mMobileContact = ServiceCenter.mobileContactMgr.getMobileContactByPhoneNumberMD5(fMessageFriendInfo.phoneNumMD5);
					}
				}
			}
			if (this.mMobileContact == null)
			{
				this.ctrlMoblie.set_Visibility(1);
				return;
			}
			string strMobile = this.mMobileContact.strMobile;
			string arg_106_0 = this.mMobileContact.strRealName;
			if (!ToolFunction.isBlankString(strMobile))
			{
				List<string> list = new List<string>();
				list.Add(strMobile);
				InfoQuery.getCurrentListHeadImg(list);
				this.ctrlMoblie.InfoData = ProfileDataMgr.GetMoblieInfo(this.mMobileContact.strRealName, strMobile, null);
				if (ContactDetailFromType.FROM_MOBILECONTACT == this.mContactDitailViewArgs.mFromType && this.mContactDitailViewArgs.mContact == null)
				{
					this.txtPhoneName2.set_Text(this.mMobileContact.strRealName);
					this.topInfoCtrl.set_Visibility(1);
					this.panelMobileContactNotMMUser.set_Visibility(0);
					return;
				}
			}
			else
			{
				this.ctrlMoblie.set_Visibility(1);
			}
		}
		public void refreshMoblieHeadImg(Dictionary<string, Stream> dictImages)
		{
			Log.smethod_5("ContactDetailViewForAll", "RefreshHeadImg");
			if (this.mMobileContact != null && this.mMobileContact.strMobile != null)
			{
				if (dictImages.ContainsKey(this.mMobileContact.strMobile))
				{
					Stream stream = dictImages.get_Item(this.mMobileContact.strMobile);
					if (stream != null)
					{
						BitmapImage bitmapImage = new BitmapImage();
						try
						{
							bitmapImage.SetSource(stream);
						}
						catch (Exception ex)
						{
							Log.smethod_5(base.GetType().get_Name(), "bitmapimage.SetSource exception catched:" + ex.get_Message());
						}
						this.ctrlMoblie.SetHead(bitmapImage);
					}
				}
				return;
			}
		}
		private void disSex()
		{
			Contact mContact = this.mContactDitailViewArgs.mContact;
			this.topInfoCtrl.SetSex(mContact.nSex);
		}
		private void disAddScene()
		{
			if (!this.mContactDitailViewArgs.mContact.nSource.get_HasValue())
			{
				return;
			}
			if (!ContactMgr.isContact(this.mContactDitailViewArgs.mContact) && this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is FMessageValidInfo)
			{
				return;
			}
			if (!ContactMgr.isContact(this.mContactDitailViewArgs.mContact) && this.mContactDitailViewArgs.mFromType == ContactDetailFromType.FROM_QRCODE)
			{
				return;
			}
			AddContactScene value = (AddContactScene)this.mContactDitailViewArgs.mContact.nSource.get_Value();
			this.ctrlSource.InfoData = ProfileDataMgr.GetSourceInfo(value);
		}
		private void disVerifyInfo()
		{
		}
		private void disVerifyIcon()
		{
			Contact mContact = this.mContactDitailViewArgs.mContact;
			if (mContact != null && mContact.nVerifyFlag != 0u && !string.IsNullOrEmpty(mContact.strVerifyInfo))
			{
				byte[] vUserIcon = ServiceCenter.vuserInfoMgr.getVUserIcon(mContact.nVerifyFlag, false);
				if (vUserIcon == null)
				{
					return;
				}
				Stream stream = new MemoryStream(vUserIcon);
				if (stream == null)
				{
					return;
				}
				BitmapImage bitmapImage = new BitmapImage();
				bitmapImage.SetSource(stream);
				this.topInfoCtrl.SetVerifyInfo(bitmapImage);
			}
		}
		private void disFaceBookInfo()
		{
			this.ctrlFaceBook.set_Visibility(1);
			if (ContactDetailFromType.FROM_FACEBOOK == this.mContactDitailViewArgs.mFromType)
			{
				this.ctrlFaceBook.set_Visibility(0);
				this.ctrlFaceBook.txtAreaTitle.set_Text("Facebook");
				FBContact fBContact = this.mContactDitailViewArgs.mObject as FBContact;
				this.ctrlFaceBook.txtNicks.Text = fBContact.strFacebookName;
				BitmapImage cache = FaceBookMgr.getCache(fBContact.nID);
				if (cache != null)
				{
					this.ctrlFaceBook.imgHead.set_Source(cache);
					return;
				}
				string text = string.Format("http://graph.facebook.com/{0}/picture", fBContact.nID);
				WebClient webClient = new WebClient();
				webClient.add_OpenReadCompleted(new OpenReadCompletedEventHandler(this.w_OpenReadCompleted));
				webClient.OpenReadAsync(new Uri(text), fBContact.nID);
			}
		}
		private void w_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
		{
			FBContact fBContact = this.mContactDitailViewArgs.mObject as FBContact;
			if (fBContact == null)
			{
				return;
			}
			ulong num = (ulong)e.get_UserState();
			BitmapImage bitmapImage = null;
			try
			{
				bitmapImage = FaceBookMgr.addCache(num, e.get_Result());
			}
			catch (Exception)
			{
			}
			if (num != fBContact.nID)
			{
				return;
			}
			if (bitmapImage != null)
			{
				this.ctrlFaceBook.imgHead.set_Source(bitmapImage);
				return;
			}
			this.ctrlFaceBook.imgHead.set_Source(new ImageSourceConverter().ConvertFromString("/Resource/Img/Plugin/FaceBook/facebooks.png") as ImageSource);
		}
		public static bool GotoContactDitailView(FBContact fbInfo, bool bIsRemoveCurrentPage = false)
		{
			if (fbInfo == null)
			{
				return false;
			}
			Contact contactFromFB = FaceBookMgr.GetContactFromFB(fbInfo);
			if (contactFromFB != null)
			{
				ContactDetailViewArgs contactDetailViewArgs = new ContactDetailViewArgs
				{
					mContact = contactFromFB,
					mObject = fbInfo,
					mFromType = ContactDetailFromType.FROM_FACEBOOK
				};
				ToolFunction.GotoPageForUserControl("/Source/UI/Contact/ContactDetailViewForAll.xaml", new object[]
				{
					contactDetailViewArgs
				}, bIsRemoveCurrentPage);
				return true;
			}
			PhoneApplicationFrame phoneApplicationFrame = Application.get_Current().get_RootVisual() as PhoneApplicationFrame;
			BasePage basePage = phoneApplicationFrame.get_Content() as BasePage;
			if (basePage == null)
			{
				return false;
			}
			InviteFriends.StartInvite(basePage, fbInfo);
			return true;
		}
		private void disTencentWeibo()
		{
			Contact mContact = this.mContactDitailViewArgs.mContact;
			if (mContact != null && !string.IsNullOrEmpty(mContact.strWeibo) && ContactMgr.isTWeiboShown(mContact))
			{
				this.ctrlTWeibo.InfoData = ProfileDataMgr.GetTencentWeiboInfo(null, mContact.strWeiboNickname, mContact.strWeibo);
			}
		}
		private void disAblum()
		{
			if (this.mBHasAblumCtrl)
			{
				return;
			}
			if (this.mContactDitailViewArgs.mContact != null && this.mContactDitailViewArgs.mContact.nSnsFlag == 1u)
			{
				this.ablumCtrl = ProfileAblumCtrl.GetOneItem();
				this.panelAblum.get_Children().Insert(0, this.ablumCtrl);
				this.mBHasAblumCtrl = true;
				this.ablumCtrl.ItemObject = this.mContactDitailViewArgs.mContact;
			}
		}
		private void disBrandList()
		{
			if (this.mBHasBrandListCtrl)
			{
				return;
			}
			if (this.mContactDitailViewArgs.mContact != null && !string.IsNullOrEmpty(this.mContactDitailViewArgs.mContact.strMyBrandList))
			{
				this.brandListCtrl = ProfileBrandListCtrl.GetOneItem();
				this.panelContentInfo.get_Children().Insert(this.mNCtrlAreaIndex, this.brandListCtrl);
				this.mBHasBrandListCtrl = true;
				this.brandListCtrl.ItemObject = this.mContactDitailViewArgs.mContact;
			}
		}
		private void disStar()
		{
			if (this.mContactDitailViewArgs != null && this.mContactDitailViewArgs.mContact != null)
			{
				if (this.mContactDitailViewArgs.mContact.strUsrName == AccountMgr.strUsrName)
				{
					this.topInfoCtrl.HideStar();
					return;
				}
				Contact contact = StorageMgr.contact.method_0(this.mContactDitailViewArgs.mContact.strUsrName);
				if (contact != null && ContactMgr.isContact(contact))
				{
					this.topInfoCtrl.SetContact(contact);
					this.topInfoCtrl.ShowStar();
					return;
				}
			}
			this.topInfoCtrl.HideStar();
		}
		private void topInfoCtrl_mImgHeadClicked(object sender, object args)
		{
			if (this.mContactDitailViewArgs != null && this.mContactDitailViewArgs.mContact != null && this.mContactDitailViewArgs.mContact.strUsrName != null && !("weixin" == this.mContactDitailViewArgs.mContact.strUsrName))
			{
				object[] object_ = new object[]
				{
					args,
					this.mContactDitailViewArgs.mContact.strUsrName,
					sender
				};
				if (this.mContactDitailViewArgs.mObject != null && (this.mContactDitailViewArgs.mObject is FMessageValidInfo || this.mContactDitailViewArgs.mObject is FMessageFriendInfo) && StorageMgr.contact.method_0(this.mContactDitailViewArgs.mContact.strUsrName) == null && this.mContactDitailViewArgs.mContact.nImgFlag != 4u)
				{
					HDheadImgMgr.setHasHDheadImg(this.mContactDitailViewArgs.mContact.strUsrName, true);
				}
				base.GoToPage("/Source/UI/Contact/HighQualityHeadImgView.xaml", object_, false);
				return;
			}
		}
		private void btnSendInvite_Click(object sender, RoutedEventArgs e)
		{
			if (this.mMobileContact == null)
			{
				return;
			}
			if (!BasePage.CanDoBackSysTask())
			{
				return;
			}
			BasePage.DoBackSysTask();
			Account curAccount = AccountMgr.getCurAccount();
			if (curAccount == null)
			{
				return;
			}
			string text = string.IsNullOrEmpty(curAccount.strAlias) ? curAccount.strUsrName : curAccount.strAlias;
			SmsComposeTask smsComposeTask = new SmsComposeTask();
			smsComposeTask.set_Body(strings.Con_Detail_StrInvitation + text);
			smsComposeTask.set_To(this.mMobileContact.strMobile);
			smsComposeTask.Show();
		}
		private void btnAcceptInvite_Click(object sender, object object_0)
		{
			this.btnAddContacList_Click(null, null);
		}
		private void btnExpose_MenuItem_Click(object sender, EventArgs e)
		{
			this.btnExpose_Click(null, null);
		}
		private void btnExpose_Click(object sender, RoutedEventArgs e)
		{
			MMMessageBox mMMessageBox = MMMessageBox.Show(strings.Lbs_PeoInfo_MsgExposeTitle, strings.Lbs_PeoInfo_MsgExposeContent, false, strings.COM_Yes, strings.COM_No);
			mMMessageBox.ReturnEvent = new DlgReturnEvent(this.msgBoxExposeHandler);
		}
		public void msgBoxExposeHandler(DlgReturnEventArg dlgReturnEventArg_0)
		{
			if (this.mContactDitailViewArgs.mFromType != ContactDetailFromType.FROM_FRIENDVERIFY)
			{
				return;
			}
			ExposeScene scene = ExposeScene.MM_EXPOSE_LBS_RCVGREET;
			if (this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is FMessageValidInfo)
			{
				FMessageValidInfo fMessageValidInfo = this.mContactDitailViewArgs.mObject as FMessageValidInfo;
				switch (fMessageValidInfo.scene)
				{
				case 18:
					scene = ExposeScene.MM_EXPOSE_LBS_RCVGREET;
					break;
				case 22:
				case 23:
				case 24:
				case 26:
				case 27:
				case 28:
				case 29:
					scene = ExposeScene.MM_EXPOSE_SHAKE_RCVGREET;
					break;
				case 25:
					scene = ExposeScene.MM_EXPOSE_BOTTLE_RCVGREET;
					break;
				}
			}
			if (this.mContactDitailViewArgs.mContact == null)
			{
				return;
			}
			if (MMMessageBox.GetUserClickResult(dlgReturnEventArg_0) == 0)
			{
				ServiceCenter.sceneExpose.doScene(this.mContactDitailViewArgs.mContact.strUsrName, scene, 0u);
			}
		}
		private void btnSayHi_Click(object sender, RoutedEventArgs e)
		{
			Dialog2BtnWithInputBox.Show(strings.Lbs_PeoInfo_MsgSayHiTitle, strings.Lbs_PeoInfo_MsgSayHiContent, strings.COM_Send, strings.COM_Cancel, "", new Dialog2BtnWithInputBox.dismissWithClickBtn(this.SayHiDialogHandler2), new TextChangedEventHandler(this.SayHiInputChangedHandler), null);
		}
		private void SayHiInputChangedHandler(object sender, TextChangedEventArgs e)
		{
			if (sender != null && sender is Dialog2BtnWithInputBox)
			{
				Dialog2BtnWithInputBox dialog2BtnWithInputBox = sender as Dialog2BtnWithInputBox;
				if (ToolFunction.getStrDisLen(dialog2BtnWithInputBox.txtIn.get_Text()) <= 20)
				{
					dialog2BtnWithInputBox.btnLeft.set_IsEnabled(true);
					this.mStrSayHiOrigin = dialog2BtnWithInputBox.txtIn.get_Text();
					return;
				}
				if (this.mStrSayHiOrigin != null && this.mStrSayHiOrigin.get_Length() < dialog2BtnWithInputBox.txtIn.get_Text().get_Length())
				{
					dialog2BtnWithInputBox.txtIn.set_Text(this.mStrSayHiOrigin);
					dialog2BtnWithInputBox.txtIn.set_SelectionStart(dialog2BtnWithInputBox.txtIn.get_Text().get_Length());
				}
				this.mStrSayHiOrigin = dialog2BtnWithInputBox.txtIn.get_Text();
			}
		}
		private void SayHiDialogHandler2(object sender, int nClickIndex)
		{
			if (nClickIndex == 0 && sender != null && sender is Dialog2BtnWithInputBox)
			{
				Dialog2BtnWithInputBox dialog2BtnWithInputBox = sender as Dialog2BtnWithInputBox;
				string text = dialog2BtnWithInputBox.txtIn.get_Text();
				if (text != null)
				{
					int arg_33_0 = text.get_Length();
				}
				string content = text;
				if (this.mContactDitailViewArgs.mFromType != ContactDetailFromType.FROM_QRCODE)
				{
					return;
				}
				if (this.mContactDitailViewArgs.mContact == null || this.mContactDitailViewArgs.mContact.strUsrName == null)
				{
					return;
				}
				string strUsrName = this.mContactDitailViewArgs.mContact.strUsrName;
				NetSceneSayHiEx netSceneSayHiEx = new NetSceneSayHiEx();
				netSceneSayHiEx.doSceneEx(strUsrName, content, AddContactScene.MM_ADDSCENE_QRCode, EventConst.ON_LBS_SAYHI_SUCCESS, EventConst.ON_LBS_SAYHI_ERROR);
			}
		}
		private void setAppBar()
		{
			if (this.mContactDitailViewArgs == null)
			{
				return;
			}
			if (this.mContactDitailViewArgs.mFromType == ContactDetailFromType.FROM_QRCODE)
			{
				this.btnSayHi.set_Visibility(0);
				return;
			}
			if (this.mContactDitailViewArgs.mContact != null)
			{
				Contact mContact = this.mContactDitailViewArgs.mContact;
				if (mContact.strUsrName == AccountMgr.strUsrName)
				{
					this.setAppbarMe();
					return;
				}
				if (ContactMgr.isContact(mContact) && this.mAppBarKind != ContactDetailViewForAll.AppBarKind.Kind_Freind)
				{
					this.mAppBarKind = ContactDetailViewForAll.AppBarKind.Kind_Freind;
					this.setAppBarMMFreind();
					return;
				}
				if (!ContactMgr.isContact(mContact) && this.mAppBarKind != ContactDetailViewForAll.AppBarKind.Kind_NotFreind)
				{
					this.mAppBarKind = ContactDetailViewForAll.AppBarKind.Kind_NotFreind;
					this.setAppBarMMNotFreind();
					return;
				}
			}
			else
			{
				base.set_ApplicationBar(null);
			}
		}
		private void setAppBarMMFreind()
		{
			Log.smethod_5("ContactDetailViewForAll", "setAppBarMMFreind()");
			ApplicationBar applicationBar = new ApplicationBar();
			applicationBar.set_IsMenuEnabled(true);
			applicationBar.set_IsVisible(true);
			if (applicationBar != null)
			{
				applicationBar.set_BackgroundColor(((SolidColorBrush)R.theme.COMMON_APPBAR_BK_BRUSH).get_Color());
				applicationBar.set_ForegroundColor(((SolidColorBrush)R.theme.COMMON_APPBAR_FG_BRUSH).get_Color());
			}
			this.btnAcceptInvite.set_Visibility(1);
			this.btnExpose.set_Visibility(1);
			ApplicationBarIconButton applicationBarIconButton = new ApplicationBarIconButton(new Uri("/Resource/Img/ContactList/Ico_AppBar_SendMsg.png", 2));
			applicationBarIconButton.set_Text(strings.Con_Detail_BtnChat);
			applicationBarIconButton.add_Click(new EventHandler(this.btnSendMsg_Click));
			applicationBar.get_Buttons().Add(applicationBarIconButton);
			if (this.mContactDitailViewArgs.mContact.strUsrName != "weixin")
			{
				ApplicationBarMenuItem applicationBarMenuItem = new ApplicationBarMenuItem(strings.MessageShareCard);
				applicationBarMenuItem.add_Click(new EventHandler(this.shareCardBtn_Click));
				applicationBar.get_MenuItems().Add(applicationBarMenuItem);
				ApplicationBarMenuItem applicationBarMenuItem2 = new ApplicationBarMenuItem(strings.Con_Detail_BtnRemark);
				applicationBarMenuItem2.add_Click(new EventHandler(this.btnRemark_Click));
				applicationBar.get_MenuItems().Add(applicationBarMenuItem2);
				string text = ContactMgr.isBlackList(this.mContactDitailViewArgs.mContact) ? strings.Con_Detail_BtnBlackOut : strings.Con_Detail_BtnBlackIn;
				this.blackListMenuItem = new ApplicationBarMenuItem(text);
				this.blackListMenuItem.add_Click(new EventHandler(this.btnBlackList_Click));
				applicationBar.get_MenuItems().Add(this.blackListMenuItem);
				ApplicationBarMenuItem applicationBarMenuItem3 = new ApplicationBarMenuItem(strings.Con_Detail_BtnDel);
				applicationBarMenuItem3.add_Click(new EventHandler(this.btnDelete_Click));
				applicationBar.get_MenuItems().Add(applicationBarMenuItem3);
			}
			base.set_ApplicationBar(applicationBar);
			this.isFriendBar = true;
			this.setAppBarStyle(base.get_ApplicationBar());
		}
		private void shareCardBtn_Click(object sender, EventArgs e)
		{
			SelectCard.StartSelectCard(this, ChatContainerPage.getCuChatPage(), this.mContactDitailViewArgs.mContact.strUsrName, SelectCard.SelectCardFromType.fromProfilePage);
		}
		private void btnTestPage_Click(object sender, EventArgs e)
		{
			TestPage.sStrUserToSend = this.mContactDitailViewArgs.mContact.strUsrName;
			ToolFunction.GotoPageForUserControl("/Source/UI/LogView/TestPage.xaml", null, true);
		}
		private bool needDisplayExpose()
		{
			bool result = false;
			if (this.mContactDitailViewArgs.mFromType == ContactDetailFromType.FROM_FRIENDVERIFY && this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is FMessageValidInfo)
			{
				FMessageValidInfo fMessageValidInfo = this.mContactDitailViewArgs.mObject as FMessageValidInfo;
				int scene = fMessageValidInfo.scene;
				if (scene != 9)
				{
					switch (scene)
					{
					case 18:
					case 22:
					case 23:
					case 24:
					case 25:
					case 26:
					case 27:
					case 28:
					case 29:
						break;
					case 19:
					case 20:
					case 21:
						return result;
					default:
						return result;
					}
				}
				result = true;
			}
			return result;
		}
		private void setAppBarMMNotFreind()
		{
			Log.smethod_5("ContactDetailViewForAll", "setAppBarMMNotFreind()");
			ApplicationBar applicationBar = new ApplicationBar();
			applicationBar.set_IsMenuEnabled(true);
			applicationBar.set_IsVisible(true);
			if (applicationBar != null)
			{
				applicationBar.set_BackgroundColor(((SolidColorBrush)R.theme.COMMON_APPBAR_BK_BRUSH).get_Color());
				applicationBar.set_ForegroundColor(((SolidColorBrush)R.theme.COMMON_APPBAR_FG_BRUSH).get_Color());
			}
			string content;
			if (this.mContactDitailViewArgs.mFromType == ContactDetailFromType.FROM_FRIENDVERIFY)
			{
				content = strings.Con_Detail_BtnAccept;
			}
			else
			{
				content = strings.Con_Detail_BtnAddToCon;
			}
			this.btnAcceptInvite.set_Content(content);
			this.btnAcceptInvite.set_Visibility(0);
			string text;
			if (ContactMgr.isBlackList(this.mContactDitailViewArgs.mContact))
			{
				text = strings.Con_Detail_BtnBlackOut;
			}
			else
			{
				text = strings.Con_Detail_BtnBlackIn;
			}
			this.blackListMenuItem = new ApplicationBarMenuItem(text);
			this.blackListMenuItem.add_Click(new EventHandler(this.btnBlackList_Click));
			applicationBar.get_MenuItems().Add(this.blackListMenuItem);
			if (this.needDisplayExpose())
			{
				ApplicationBarMenuItem applicationBarMenuItem = new ApplicationBarMenuItem(strings.Lbs_PeoInfo_BtnExpose);
				applicationBarMenuItem.add_Click(new EventHandler(this.btnExpose_MenuItem_Click));
				applicationBar.get_MenuItems().Add(applicationBarMenuItem);
			}
			base.set_ApplicationBar(applicationBar);
			this.isFriendBar = false;
			this.setAppBarStyle(base.get_ApplicationBar());
		}
		private void setAppbarMe()
		{
			if (this.mBarSelf == null)
			{
				Log.smethod_5("ContactDetailViewForAll", "setAppBarMMFreind()");
				ApplicationBar applicationBar = new ApplicationBar();
				applicationBar.set_IsMenuEnabled(true);
				applicationBar.set_IsVisible(true);
				ApplicationBarIconButton applicationBarIconButton = new ApplicationBarIconButton(new Uri("/Resource/Img/Profile/EditMe.png", 2));
				applicationBarIconButton.set_Text(strings.Set_Main_Edit);
				applicationBarIconButton.add_Click(new EventHandler(this.btnEdit_Click));
				applicationBar.get_Buttons().Add(applicationBarIconButton);
				base.set_ApplicationBar(applicationBar);
				this.isFriendBar = false;
				this.setAppBarStyle(base.get_ApplicationBar());
				this.mBarSelf = applicationBar;
				return;
			}
			if (base.get_ApplicationBar() == this.mBarSelf)
			{
				return;
			}
			base.set_ApplicationBar(this.mBarSelf);
			this.isFriendBar = false;
			this.setAppBarStyle(base.get_ApplicationBar());
		}
		private void btnEdit_Click(object sender, EventArgs e)
		{
			base.GoToPage("/Source/UI/Setting/PersonalInfoView.xaml", null, true);
		}
		private void btnRemark_Click(object sender, EventArgs e)
		{
			object[] array = new object[2];
			array[0] = new DelegateSetRemark(this.setRemarkName);
			string text = this.mContactDitailViewArgs.mContact.strNickName;
			if (ToolFunction.checkIsLegalRemark(this.mContactDitailViewArgs.mContact.strRemark))
			{
				text = this.mContactDitailViewArgs.mContact.strRemark;
			}
			array[1] = text;
			base.GoToPage("/Source/UI/Contact/ContactSetRemarkView.xaml", array, false);
		}
		private void setRemarkName(string strNewRemark)
		{
			if (this.mContactDitailViewArgs.mContact == null)
			{
				return;
			}
			if (this.mContactDitailViewArgs.mContact.strRemark == strNewRemark)
			{
				return;
			}
			this.mContactDitailViewArgs.mContact.strRemark = strNewRemark;
			this.mContactDitailViewArgs.mContact.strRemarkPYInitial = SortStringsByAlpha.ConvertStringToPinyinInitial(strNewRemark);
			this.mContactDitailViewArgs.mContact.strRemarkQuanPin = GetPinYin.ConvertStrToQuanPin(strNewRemark);
			ContactMgr.operationModContact(this.mContactDitailViewArgs.mContact);
			this.disRemark();
			MessageBoxManager.ShowToast(strings.Con_Detail_MsgRemarkSucc, 2500, null, false);
		}
		private void btnSendMsg_Click(object sender, EventArgs e)
		{
			ChatContainerPage.GoToChatPage(this, this.mContactDitailViewArgs.mContact.strUsrName, null, null, null);
		}
		private void btnDelete_Click(object sender, EventArgs e)
		{
			MMMessageBox mMMessageBox = MMMessageBox.Show(strings.Con_Detail_MsgDelTitle, string.Format(strings.Con_Detail_MsgDelContent, this.mContactDitailViewArgs.mContact.strNickName), true, strings.Con_Detail_MsgDelBtnLeft, strings.COM_Cancel);
			mMMessageBox.ReturnEvent = new DlgReturnEvent(this.OnDeleteContactHandler);
		}
		private void OnDeleteContactHandler(DlgReturnEventArg dlgReturnEventArg_0)
		{
			switch (MMMessageBox.GetUserClickResult(dlgReturnEventArg_0))
			{
			case 0:
				ContactHelper.DeleteContact(this.mContactDitailViewArgs.mContact, true);
				this.refreshUI();
				break;
			case 1:
				break;
			default:
				return;
			}
		}
		private void btnBlackList_Click(object sender, EventArgs e)
		{
			bool flag;
			if (flag = ContactMgr.isBlackList(this.mContactDitailViewArgs.mContact))
			{
				string con_Detail_MsgBlackOutSucc = strings.Con_Detail_MsgBlackOutSucc;
				string con_Detail_BtnBlackIn = strings.Con_Detail_BtnBlackIn;
				ContactMgr.operationSetBlackList(this.mContactDitailViewArgs.mContact, !flag);
				if (this.mMobileContact != null)
				{
					MobileContactMgr.moveOutBlackList(this.mMobileContact);
				}
				MessageBoxManager.ShowToast(con_Detail_MsgBlackOutSucc, 2500, null, false);
				if (this.blackListMenuItem != null)
				{
					this.blackListMenuItem.set_Text(con_Detail_BtnBlackIn);
				}
				ServiceCenter.sceneNewSync.doScene(4, syncScene.MM_NEWSYNC_SCENE_OTHER);
				return;
			}
			MMMessageBox mMMessageBox = MMMessageBox.Show("", strings.Con_Detail_MsgBlackInTitle, true, strings.COM_Confirm, strings.COM_Cancel);
			mMMessageBox.ReturnEvent = new DlgReturnEvent(this.OnAddBlackListHandler);
		}
		private void OnAddBlackListHandler(DlgReturnEventArg dlgReturnEventArg_0)
		{
			switch (MMMessageBox.GetUserClickResult(dlgReturnEventArg_0))
			{
			case 0:
			{
				string con_Detail_MsgBlackInSucc = strings.Con_Detail_MsgBlackInSucc;
				string con_Detail_BtnBlackOut = strings.Con_Detail_BtnBlackOut;
				ContactMgr.operationSetBlackList(this.mContactDitailViewArgs.mContact, true);
				if (this.mMobileContact != null)
				{
					MobileContactMgr.addInBlackList(this.mMobileContact);
				}
				MessageBoxManager.ShowToast(con_Detail_MsgBlackInSucc, 2500, null, false);
				if (this.blackListMenuItem != null)
				{
					this.blackListMenuItem.set_Text(con_Detail_BtnBlackOut);
				}
				ServiceCenter.sceneNewSync.doScene(4, syncScene.MM_NEWSYNC_SCENE_OTHER);
				break;
			}
			case 1:
				break;
			default:
				return;
			}
		}
		private void btnSendCard_Click(object sender, EventArgs e)
		{
			this.btnAddContacList_Click(null, null);
		}
		private void btnAddContacList_Click(object sender, EventArgs e)
		{
			if (this.mContactDitailViewArgs == null)
			{
				return;
			}
			if (ContactDetailFromType.FROM_FRIENDVERIFY == this.mContactDitailViewArgs.mFromType)
			{
				ProcessingCover.getProgressBar(this.LayoutRoot, strings.Con_Detail_MsgSendingVerify, null, false, false, null);
				ServiceCenter.sceneVerifyUser.doSceneAcceptForAddContact(this.mContactDitailViewArgs.mContact.strUsrName, this.getAddContactScene());
				return;
			}
			if (ContactDetailFromType.FROM_SEARCHCONTACT == this.mContactDitailViewArgs.mFromType)
			{
				ProcessingCover.getProgressBar(this.LayoutRoot, strings.Con_Detail_MsgSendingReq, null, false, false, null);
				ServiceCenter.sceneVerifyUser.doSceneAddContact(this.mContactDitailViewArgs.mContact.strUsrName, this.getAddContactScene());
				return;
			}
			ProcessingCover.getProgressBar(this.LayoutRoot, strings.Con_Detail_MsgSendingReq, null, false, false, null);
			ServiceCenter.sceneVerifyUser.doSceneAddContact(this.mContactDitailViewArgs.mContact.strUsrName, this.getAddContactScene());
		}
		private AddContactScene getAddContactScene()
		{
			if (this.mContactDitailViewArgs == null)
			{
				return AddContactScene.MM_ADDSCENE_PF_UNKNOWN;
			}
			if (this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is FMessageValidInfo)
			{
				return (AddContactScene)(this.mContactDitailViewArgs.mObject as FMessageValidInfo).scene;
			}
			if (this.mContactDitailViewArgs.mObject != null && this.mContactDitailViewArgs.mObject is FMessageFriendInfo)
			{
				return (AddContactScene)(this.mContactDitailViewArgs.mObject as FMessageFriendInfo).scene;
			}
			switch (this.mContactDitailViewArgs.mFromType)
			{
			case ContactDetailFromType.FROM_MOBILECONTACT:
				return AddContactScene.MM_ADDSCENE_VIEW_MOBILE;
			case ContactDetailFromType.FROM_LBS:
				return AddContactScene.MM_ADDSCENE_LBS;
			case ContactDetailFromType.FROM_CHATGROUP:
				return AddContactScene.MM_ADDSCENE_CHATROOM;
			case ContactDetailFromType.FROM_SEARCHWEIXIN:
				return AddContactScene.MM_ADDSCENE_SEARCH_WEIXIN;
			case ContactDetailFromType.FROM_SEARCHQQ:
				return AddContactScene.MM_ADDSCENE_SEARCH_QQ;
			case ContactDetailFromType.FROM_SEARCHEMAIL:
				return AddContactScene.MM_ADDSCENE_SEARCH_EMAIL;
			case ContactDetailFromType.FROM_SEARCHPHONE:
				return AddContactScene.MM_ADDSCENE_SEARCH_PHONE;
			}
			return AddContactScene.MM_ADDSCENE_PF_UNKNOWN;
		}
		public static ContactDetailViewArgs getConDetailArgFromFMessageValidInfo(FMessageValidInfo info)
		{
			Contact contact = StorageMgr.contact.method_0(info.UserName);
			if (ToolFunction.isBlankString(info.content))
			{
				switch (info.scene)
				{
				case 18:
				case 22:
				case 23:
				case 24:
				case 25:
				case 26:
				case 27:
				case 28:
				case 29:
					info.content = strings.Con_Detail_StrSayHiDeft;
					goto IL_76;
				case 19:
				case 20:
				case 21:
					IL_5E:
					info.content = strings.Con_Detail_StrVerifyDeft;
					goto IL_76;
				}
				goto IL_5E;
			}
			IL_76:
			if (contact == null || string.IsNullOrEmpty(contact.strNickName))
			{
				contact = new Contact
				{
					strUsrName = info.UserName,
					strNickName = info.NickName,
					strProvince = info.province,
					strCity = info.city,
					strPYInitial = info.shortpy,
					nSex = info.int_0,
					strVerifyInfo = info.content,
					nImgFlag = (uint)info.imagestatus,
					nSnsFlag = (uint)info.nSnsFlag,
					nSnsBGObjectID = info.nSnsBGObjectID,
					strSnsBGImgID = info.strSnsbgimgid
				};
			}
			return new ContactDetailViewArgs
			{
				mContact = contact,
				mStrFirstTitle = strings.Con_Detail_TxtTitleVerify,
				mStrSecondTitle = strings.Con_Detail_TxtTitleDetail,
				mFromType = ContactDetailFromType.FROM_FRIENDVERIFY,
				mObject = info
			};
		}
		public static ContactDetailViewArgs getConDetailArgFromFMessageFriendInfo(FMessageFriendInfo info)
		{
			Contact contact = StorageMgr.contact.method_0(info.UserName);
			if (contact == null)
			{
				contact = new Contact
				{
					strUsrName = info.UserName,
					strNickName = info.NickName,
					strPYInitial = info.pyInitial,
					strVerifyInfo = info.ConversationInfo,
					nSnsFlag = (uint)info.nSnsFlag,
					nSnsBGObjectID = info.nSnsBGObjectID,
					strSnsBGImgID = info.strSnsbgimgid,
					nImgFlag = (uint)info.imageFlag
				};
			}
			int scene = info.scene;
			ContactDetailFromType mFromType;
			if (scene != 4)
			{
				if (scene != 10)
				{
					mFromType = ContactDetailFromType.FROM_FRIENDPUSH_MAYKNOW;
				}
				else
				{
					mFromType = ContactDetailFromType.FROM_FRIENDPUSH_MOBILE;
				}
			}
			else
			{
				mFromType = ContactDetailFromType.FROM_FRIENDPUSH_QQ;
			}
			return new ContactDetailViewArgs
			{
				mContact = contact,
				mStrFirstTitle = strings.Con_Detail_TxtTitleFMessage,
				mStrSecondTitle = strings.Con_Detail_TxtTitleDetail,
				mFromType = mFromType,
				mObject = info
			};
		}
		public static ContactDetailViewArgs getConDetailArgFromShareCardInfo(CardMsgInfo info)
		{
			Contact contact = StorageMgr.contact.method_0(info.UserName);
			if (contact == null || string.IsNullOrEmpty(contact.strNickName))
			{
				contact = new Contact
				{
					strUsrName = info.UserName,
					strNickName = info.NickName,
					strProvince = info.province,
					strCity = info.city,
					strPYInitial = info.shortpy,
					nSex = info.int_0,
					nSnsFlag = 0u,
					nImgFlag = (uint)info.imagestatus,
					nVerifyFlag = (uint)info.certflag,
					strVerifyInfo = info.certinfo,
					strBrandExternalInfo = info.brandHomeUrl,
					strBrandIconURL = info.brandIconUrl
				};
			}
			return new ContactDetailViewArgs
			{
				mContact = contact,
				mStrFirstTitle = strings.Con_Detail_TxtTitleVerify,
				mStrSecondTitle = strings.Con_Detail_TxtTitleDetail,
				mFromType = ContactDetailFromType.FROM_FRIENDPUSH_MOBILE,
				mObject = info
			};
		}
		public static bool GotoContactDitailView(string strFirstTitle, string strSecondTitle, Contact contact, ContactDetailFromType fromType, bool bIsRemoveCurrentPage = false)
		{
			if (contact == null)
			{
				return false;
			}
			ContactDetailViewForAll.GotoProfile(new ContactDetailViewArgs
			{
				mContact = contact,
				mFromType = fromType,
				mStrFirstTitle = strFirstTitle,
				mStrSecondTitle = strSecondTitle
			}, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoContactDitailView(string strUserName, ContactDetailFromType fromType = ContactDetailFromType.FROM_MMCONTACT, bool bIsRemoveCurrentPage = false)
		{
			Contact contact = StorageMgr.contact.method_0(strUserName);
			return contact != null && ContactDetailViewForAll.GotoContactDitailView(strings.COM_ConList, strings.COM_ConDetail, contact, fromType, false);
		}
		public static bool GotoContactDitailView(FMessageValidInfo info, bool bIsRemoveCurrentPage = false)
		{
			if (info == null)
			{
				return false;
			}
			ContactDetailViewArgs conDetailArgFromFMessageValidInfo = ContactDetailViewForAll.getConDetailArgFromFMessageValidInfo(info);
			if (info == null)
			{
				return false;
			}
			ContactDetailViewForAll.GotoProfile(conDetailArgFromFMessageValidInfo, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoContactDitailView(FMessageFriendInfo info, bool bIsRemoveCurrentPage = false)
		{
			if (info == null)
			{
				return false;
			}
			ContactDetailViewArgs conDetailArgFromFMessageFriendInfo = ContactDetailViewForAll.getConDetailArgFromFMessageFriendInfo(info);
			if (info == null)
			{
				return false;
			}
			ContactDetailViewForAll.GotoProfile(conDetailArgFromFMessageFriendInfo, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoContactDitailView(ContactDetailViewArgs contactDetailArg, bool bIsRemoveCurrentPage = false)
		{
			if (contactDetailArg != null && contactDetailArg.mContact != null)
			{
				ContactDetailViewForAll.GotoProfile(contactDetailArg, bIsRemoveCurrentPage);
				return true;
			}
			return false;
		}
		public static bool GotoContactDitailView(PhoneNumInfo phoneNumInfo, bool bIsRemoveCurrentPage = false)
		{
			if (phoneNumInfo == null)
			{
				return false;
			}
			MobileContact mobileContact;
			if (ToolFunction.isBlankString(phoneNumInfo.strUserName))
			{
				mobileContact = new MobileContact
				{
					strRealName = phoneNumInfo.Name,
					strMobile = phoneNumInfo.Num
				};
			}
			else
			{
				mobileContact = ServiceCenter.mobileContactMgr.getMobileContactByUserName(phoneNumInfo.strUserName);
			}
			if (mobileContact == null)
			{
				return false;
			}
			Contact contact = StorageMgr.contact.method_0(phoneNumInfo.strUserName);
			if (contact == null && mobileContact.nStatus != 0)
			{
				contact = new Contact
				{
					strUsrName = mobileContact.strUsrName,
					strAlias = mobileContact.strAlias,
					strNickName = mobileContact.strNickName,
					strSignature = mobileContact.strSignature,
					strCity = mobileContact.strCity,
					strProvince = mobileContact.strProvince,
					nSex = -1,
					nSnsFlag = mobileContact.nSnsFlag,
					nSnsBGObjectID = mobileContact.nSnsBGObjectID,
					strSnsBGImgID = mobileContact.strSnsBGImgID,
					nImgFlag = (uint)mobileContact.hasHeadImg,
					strPYInitial = mobileContact.strNickNamePYInitial,
					nFlags = mobileContact.nFlag
				};
			}
			ContactDetailViewArgs args = new ContactDetailViewArgs
			{
				mContact = contact,
				mStrFirstTitle = strings.Con_Detail_TxtTitleFindFreind,
				mStrSecondTitle = strings.Con_Detail_TxtTitleDetail,
				mFromType = ContactDetailFromType.FROM_MOBILECONTACT,
				mObject = mobileContact
			};
			ContactDetailViewForAll.GotoProfile(args, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoContactDitailView(MobileContact mobileCon, bool bIsRemoveCurrentPage = false)
		{
			if (mobileCon == null)
			{
				return false;
			}
			Contact contact = StorageMgr.contact.method_0(mobileCon.strUsrName);
			if (contact == null && mobileCon.nStatus != 0)
			{
				contact = new Contact
				{
					strUsrName = mobileCon.strUsrName,
					strNickName = mobileCon.strNickName,
					strSignature = mobileCon.strSignature,
					strCity = mobileCon.strCity,
					strProvince = mobileCon.strProvince,
					nSnsFlag = mobileCon.nSnsFlag,
					nSnsBGObjectID = mobileCon.nSnsBGObjectID,
					strSnsBGImgID = mobileCon.strSnsBGImgID,
					nSex = -1,
					nImgFlag = (uint)mobileCon.hasHeadImg,
					strPYInitial = mobileCon.strNickNamePYInitial,
					nFlags = mobileCon.nFlag
				};
			}
			ContactDetailViewArgs args = new ContactDetailViewArgs
			{
				mContact = contact,
				mStrFirstTitle = strings.Con_Detail_TxtTitleFindFreind,
				mStrSecondTitle = strings.Con_Detail_TxtTitleDetail,
				mFromType = ContactDetailFromType.FROM_MOBILECONTACT,
				mObject = mobileCon
			};
			ContactDetailViewForAll.GotoProfile(args, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoContactDitailView(LbsPeople lbsPeople, bool bIsRemoveCurrentPage = false)
		{
			if (lbsPeople == null)
			{
				return false;
			}
			Contact contact = StorageMgr.contact.method_0(lbsPeople.strUserName);
			if (contact == null)
			{
				contact = new Contact
				{
					strUsrName = lbsPeople.strUserName,
					strNickName = lbsPeople.strNickName,
					strSignature = lbsPeople.strSignature,
					strCity = lbsPeople.strArea,
					nSex = lbsPeople.nSex,
					nSnsFlag = lbsPeople.nSnsFlag,
					nSnsBGObjectID = lbsPeople.nSnsBGObjectID,
					strSnsBGImgID = lbsPeople.strSnsBGImgID
				};
			}
			ContactDetailViewArgs args = new ContactDetailViewArgs
			{
				mContact = contact,
				mStrFirstTitle = strings.Con_Detail_TxtTitleFindFreind,
				mStrSecondTitle = strings.Con_Detail_TxtTitleDetail,
				mFromType = ContactDetailFromType.FROM_LBS,
				mObject = lbsPeople
			};
			ContactDetailViewForAll.GotoProfile(args, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoContactDitailView(SearchContactInfo searchContactInfo, ContactDetailFromType searchType = ContactDetailFromType.FROM_QRCODE, bool bIsRemoveCurrentPage = false)
		{
			if (searchContactInfo == null)
			{
				return false;
			}
			BitmapImage bitmapImage = null;
			ContactDetailFromType mFromType = ContactDetailFromType.FROM_MMCONTACT;
			try
			{
				Stream source = new MemoryStream(searchContactInfo.ImgBuf);
				bitmapImage = new BitmapImage();
				bitmapImage.SetSource(source);
			}
			catch
			{
			}
			Contact contact = StorageMgr.contact.method_0(searchContactInfo.UserName);
			if (contact == null)
			{
				contact = new Contact();
				contact.strAlias = searchContactInfo.strAlias;
				contact.strUsrName = searchContactInfo.UserName;
				contact.strProvince = searchContactInfo.Province;
				contact.strCity = searchContactInfo.City;
				contact.strSignature = searchContactInfo.Signature;
				contact.nSex = searchContactInfo.Sex;
				contact.strHeadImg = searchContactInfo.ImgBuf.ToString();
				contact.strNickName = searchContactInfo.NickName;
				contact.strVerifyInfo = searchContactInfo.VerifyInfo;
				contact.nVerifyFlag = searchContactInfo.VerifyFlag;
				contact.nSnsFlag = searchContactInfo.SnsFlag;
				contact.nSnsBGObjectID = searchContactInfo.SnsBGObjectID;
				contact.strSnsBGImgID = searchContactInfo.SnsBGImgID;
				contact.strMyBrandList = searchContactInfo.MyBrandList;
				mFromType = searchType;
				if (searchContactInfo.ImgBuf != null && searchContactInfo.ImgBuf.Length != 0)
				{
					HDheadImgMgr.setHasHDheadImg(searchContactInfo.UserName, true);
				}
			}
			ContactDetailViewArgs args = new ContactDetailViewArgs
			{
				mContact = contact,
				mObject = bitmapImage,
				mFromType = mFromType
			};
			ContactDetailViewForAll.GotoProfile(args, bIsRemoveCurrentPage);
			return true;
		}
		public static bool GotoProfile(ContactDetailViewArgs args, bool bIsRemoveCurrentPage = false)
		{
			if (args == null)
			{
				return false;
			}
			object[] array = new object[1];
			if (ContactHelper.IsGotoVerifiedProfile(args.mContact))
			{
				array[0] = args.mContact;
				ToolFunction.GotoPageForUserControl("/Source/UI/Contact/VerifiedPeopleInfo.xaml", array, bIsRemoveCurrentPage);
				return true;
			}
			array[0] = args;
			ToolFunction.GotoPageForUserControl("/Source/UI/Contact/ContactDetailViewForAll.xaml", array, bIsRemoveCurrentPage);
			return true;
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/Contact/ContactDetailViewForAll.xaml", 2));
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.svRoot = (ScrollViewer)base.FindName("svRoot");
			this.panelProfile = (StackPanel)base.FindName("panelProfile");
			this.panelContentInfo = (StackPanel)base.FindName("panelContentInfo");
			this.panelAblum = (Grid)base.FindName("panelAblum");
			this.panelMobileContactNotMMUser = (StackPanel)base.FindName("panelMobileContactNotMMUser");
			this.txtPhoneName2 = (TextBlock)base.FindName("txtPhoneName2");
			this.btnSendInvite = (Button)base.FindName("btnSendInvite");
			this.btnAcceptInvite = (Button)base.FindName("btnAcceptInvite");
			this.btnExpose = (Button)base.FindName("btnExpose");
			this.btnSayHi = (Button)base.FindName("btnSayHi");
		}
	}
}
